package ui.panel;

import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.stage.StageStyle;
import ui.factory.SingletonFactory;
import ui.util.Window;

import java.io.IOException;
import java.net.URL;

public class TestSvg extends Window {
    private static TestSvg instance = null;

    //调用单例工厂
    public static TestSvg getInstance() {
        if (instance == null) {
            instance = SingletonFactory.getWeakInstace(TestSvg.class);
        }
        return instance;
    }

    public TestSvg() throws IOException {
        Pane anchorPane = new Pane();
        anchorPane.setStyle("-fx-background-color:TRANSPARENT; ");
        Button rightHeart = new Button();
        rightHeart.setLayoutX(20);
        rightHeart.setLayoutY(20);
        rightHeart.setStyle("-fx-shape: 'M424.45 734.81a88.74 88.74 0 1 0 88.73-88.73 88.73 88.73 0 0 0-88.73 88.73z m0 0M652.92 431.7A361.73 361.73 0 0 0 256 509.27a47.33 47.33 0 0 0 66.93 66.93 267.09 267.09 0 0 1 378.11 0A47.33 47.33 0 0 0 768 509.27a360.63 360.63 0 0 0-115.08-77.57z m0 0 M911.37 365.88a564.35 564.35 0 0 0-798.74 0 47.33 47.33 0 0 0 66.93 66.93 469.69 469.69 0 0 1 664.88 0 47.33 47.33 0 0 0 66.93-66.93z m0 0'; -fx-background-color: #e5344d;");
        rightHeart.setPrefHeight(5);
        rightHeart.setPrefWidth(5);
        Button button= new Button();
        button.setLayoutX(40);
        button.setLayoutY(20);
        button.setStyle("-fx-shape: 'M424.45 734.81a88.74 88.74 0 1 0 88.73-88.73 88.73 88.73 0 0 0-88.73 88.73z m0 0M652.92 431.7A361.73 361.73 0 0 0 256 509.27a47.33 47.33 0 0 0 66.93 66.93 267.09 267.09 0 0 1 378.11 0A47.33 47.33 0 0 0 768 509.27a360.63 360.63 0 0 0-115.08-77.57z m0 0 M911.37 365.88a564.35 564.35 0 0 0-798.74 0 47.33 47.33 0 0 0 66.93 66.93 469.69 469.69 0 0 1 664.88 0 47.33 47.33 0 0 0 66.93-66.93z m0 0'; -fx-background-color: #e5344d;");
        button.setPrefHeight(1);
        button.setPrefWidth(1);

        anchorPane.getChildren().addAll(rightHeart,button);

        Scene scene = new Scene(anchorPane, 800, 700);
        initStyle(StageStyle.TRANSPARENT);
        scene.setFill(Color.TRANSPARENT);
        setScene(scene);
        setTitle("IceoLogy壁纸");
    }
}
